<template>
  <h1>首页</h1>
</template>

<script>
import { useRoute, useRouter } from 'vue-router'

export default {
  setup() {
    // 1. 如何获取 this.$route    => useRoute()
    const route = useRoute()
    console.log('route', route)

    // 2. 如何获取  this.$router  => useRouter()
    const router = useRouter()
    console.log('router', router)
  }
}
</script>
